package com.bhs.mappers.menu;

import com.bhs.pojo.Item;
import com.bhs.pojo.MainMenu;
import com.bhs.pojo.Menu;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface LeftMenuMapper {
    @Select("select id,name from menu")
    List<Menu> getLeftMenu();

    @Select("SELECT id,menu_id,NAME,price,img_path,created,updated,STATUS,top_menu_id,repertory " +
            "FROM item " +
            "WHERE menu_id=#{id}")
    List<Item> getLeftItemList(Integer id);

    /**
     * 获取主页商品列表
     * 只获取每个分类的前十条
     */
    @Select("select " +
            "id,menu_id,NAME,price,img_path,created,updated,STATUS,top_menu_id,repertory,advantage,main_menu_id " +
            "from item ")
    List<Item> getMainItem();

    @Select("select id,name from main_menu")
    List<MainMenu> getMainMenu();

}
